package chapter12;

import org.junit.Test;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * @author : DuJiabao
 * @Date : 2021/2/20 10:35
 * @Project : thinking_in_java
 * @File : null.java
 * @Desc :
 */
public class TryCatchTest {
  @Test
  public void test() {
    TryCatchTest tryCatchTest = new TryCatchTest();
    try {
      tryCatchTest.throwsArithmeticException();
    } catch (ArithmeticException e) {
      e.printStackTrace();
    }
    tryCatchTest.throwsArithmeticException();
  }

  public void throwsArithmeticException() throws ArithmeticException {
    throw new ArithmeticException();
  }

  public void throwsNullPointerException() throws NullPointerException {
    throw new NullPointerException();
  }

}

